<template>
    <div>
        <el-input
            class="unrestocked_shop-search_box"
            v-model="queryString"
            prefix-icon="el-icon-search"
            placeholder="按店铺名查找"
            clearable
        />
        <el-table :data="tableData">
            <el-table-column type="index" label="#" align="center" />
            <el-table-column prop="sellerName" label="店铺名" />
            <el-table-column prop="number" label="数量" />
            <el-table-column prop="name" label="收货人" />
            <el-table-column prop="phone" label="联系方式" />
            <el-table-column prop="address" label="收货地址" />
            <el-table-column label="操作">
                <template #default="{ row }">
                    <el-button type="text" @click="restock(row)">补货</el-button>
                </template>
            </el-table-column>
        </el-table>
        <div class="flex mt-3">
            <el-pagination
                class="ml-auto"
                @current-change="query"
                :currentPage.sync="currentPage"
                :total="total"
                :pageSize="pageSize"
            />
        </div>
    </div>
</template>

<script>
import { getQueryOptions } from '../../mixins';

export default {
    data() {
        return {
            tableData: [],
        };
    },

    mixins: [
        getQueryOptions({
            apiurl: '/yxl/platform/findReplenishmentShop',
            paginable: true,
            params: {
                sellerName: 'queryString',
            },
        }),
    ],

    methods: {
        restock(row) {
            this.$emit('restock', row);
        },
    },
};
</script>